package org.zhxy.zhxy.controller.front;

import cn.hutool.core.date.DateTime;
import org.springframework.format.annotation.DateTimeFormat;

import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;

public class TestController {

    public static void main(String[] args) throws ParseException {
        String start1 = "2024-12-01 12:00:00";
        String end1 = "2024-12-01 13:00:00";
        String start2 = "2024-12-01 13:00:00";
        String end2 = "2024-12-01 14:00:00";
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        long t1 = simpleDateFormat.parse(start1).getTime();
        long t2 = simpleDateFormat.parse(end1).getTime();
        long t3 = simpleDateFormat.parse(start2).getTime();
        long t4 = simpleDateFormat.parse(end2).getTime();
        System.out.println(t1);
        System.out.println(t2);
        System.out.println(t3);
        System.out.println(t4);
        /**
         *1730288152291
         1703995200000
         1703998800000
         1703998800000
         1704002400000
         */
    }
}
